<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>

    <title>Service UI Fragment</title>
    <link href="../../static/css/cas.css" rel="stylesheet" th:remove="tag"/>
</head>

<body>
<main class="container mt-3 mb-3">
    <th:block th:fragment="submitButton">
        <button
                class="mdc-button mdc-button--raised btn btn-primary btn-primary flex-shrink-0"
                th:if="${recaptchaSiteKey == null}"
                th:name="${name ?: 'submitBtn'}"
                th:id="${id ?: 'submitBtn'}"
                accesskey="l"
                type="submit">
            <i th:class="${'mdi fas ' + (iconClass ?: 'mdi-login fa-shield-alt')}" aria-hidden="true"></i>
            <span class="mdc-button__label" th:text="#{${messageKey}}">Login</span>
        </button>

        <span th:unless="${recaptchaSiteKey == null}">
             <span th:if="${#strings.equalsIgnoreCase(recaptchaVersion, 'GOOGLE_RECAPTCHA_V2')}">
                <button th:unless="${recaptchaInvisible != null AND recaptchaInvisible}"
                        class="mdc-button mdc-button--raised btn btn-primary btn btn-primary flex-shrink-0"
                        th:name="${name ?: 'submitBtn'}"
                        th:id="${id ?: 'submitBtn'}"
                        accesskey="l"
                        type="submit"
                        value="Login3">
                    <span class="mdc-button__label" th:text="#{${messageKey}}">Login</span>
                </button>
                <button th:if="${recaptchaInvisible != null AND recaptchaInvisible}"
                        class="mdc-button mdc-button--raised g-recaptcha btn btn-primary btn btn-primary flex-shrink-0"
                        th:attr="data-sitekey=${recaptchaSiteKey}, data-badge=${recaptchaPosition}"
                        data-callback="onRecaptchaV2Submit"
                        th:name="${name ?: 'submitBtn'}"
                        th:id="${id ?: 'submitBtn'}"
                        accesskey="l">
                    <span class="mdc-button__label" th:text="#{${messageKey}}" ></span>
                </button>
            </span>

            <span th:if="${#strings.equalsIgnoreCase(recaptchaVersion, 'GOOGLE_RECAPTCHA_V3')}">
                <button class="mdc-button mdc-button--raised btn btn-primary btn btn-primary flex-shrink-0"
                        th:name="${name ?: 'submitBtn'}"
                        th:id="${id ?: 'submitBtn'}"
                        th:attr="data-sitekey=${recaptchaSiteKey}"
                        accesskey="l"
                        th:value="#{screen.welcome.button.login}"
                        type="submit"
                        value="Login3">
                    <span class="mdc-button__label" th:text="#{${messageKey}}" />
                </button>
             </span>


            <span th:if="${#strings.equalsIgnoreCase(recaptchaVersion, 'HCAPTCHA')}" th:remove="tag">
                <button class="mdc-button mdc-button--raised btn btn-primary btn btn-primary flex-shrink-0"
                        th:name="${name ?: 'submitBtn'}"
                        th:id="${id ?: 'submitBtn'}"
                        accesskey="l"
                        type="submit"
                        value="Login3">
                    <span class="mdc-button__label" th:text="#{${messageKey}}">Login</span>
                </button>
            </span>

            <span th:if="${#strings.equalsIgnoreCase(recaptchaVersion, 'TURNSTILE')}" th:remove="tag">
                <button class="mdc-button mdc-button--raised btn btn-primary btn btn-primary flex-shrink-0"
                        th:name="${name ?: 'submitBtn'}"
                        th:id="${id ?: 'submitBtn'}"
                        accesskey="l"
                        type="submit"
                        value="Login4">
                    <span class="mdc-button__label" th:text="#{${messageKey}}">Login</span>
                </button>
            </span>

            <span th:if="${#strings.equalsIgnoreCase(recaptchaVersion, 'FRIENDLY_CAPTCHA')}" th:remove="tag">
                <button class="mdc-button mdc-button--raised btn btn-primary btn btn-primary flex-shrink-0"
                        th:name="${name ?: 'submitBtn'}"
                        th:id="${id ?: 'submitBtn'}"
                        accesskey="l"
                        type="submit"
                        value="Login5">
                    <span class="mdc-button__label" th:text="#{${messageKey}}">Login</span>
                </button>
            </span>

        </span>

    </th:block>
</main>
</body>

</html>
